{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MSC demo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import set_env"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from dataclasses import dataclass\n",
    "from typing import Iterator\n",
    "\n",
    "from tvm.contrib.msc.pipeline import TorchWrapper\n",
    "from tvm.contrib.msc.core.tools import ToolType\n",
    "from tvm.contrib.msc.core.utils.message import MSCStage\n",
    "from utils import *\n",
    "\n",
    "@dataclass\n",
    "class Args:\n",
    "    gym: bool = False # Whether to use gym for tool\n",
    "    prune: bool = False # Whether to use pruner\n",
    "    quantize: bool = False # Whether to use quantizer\n",
    "    distill: bool = False # Whether to use distiller for tool\n",
    "    compile_type: str = \"tvm\" # The compile type of model\n",
    "    test_batch: int = 1 # Whether to use gym for tool\n",
    "    verbose: str = \"info\" # \"The verbose level, info|debug:1,2,3|critical\n",
    "    dynamic: bool = False # Whether to use dynamic wrapper\n",
    "\n",
    "def get_config(calib_loader: Iterator, train_loader: Iterator, args: Args):\n",
    "    tools, dataset = [], {MSCStage.PREPARE: {\"loader\": calib_loader}}\n",
    "    if args.prune:\n",
    "        config = {\"gym_configs\": [\"default\"]} if args.gym else \"default\"\n",
    "        tools.append((ToolType.PRUNER, config))\n",
    "    if args.quantize:\n",
    "        config = {\"gym_configs\": [\"default\"]} if args.gym else \"default\"\n",
    "        tools.append((ToolType.QUANTIZER, config))\n",
    "    if args.distill:\n",
    "        config = {\n",
    "            \"options\": {\n",
    "                \"optimizer\": \"adam\",\n",
    "                \"opt_config\": {\"lr\": 0.00000001, \"weight_decay\": 0.08},\n",
    "            }\n",
    "        }\n",
    "        tools.append((ToolType.DISTILLER, config))\n",
    "        dataset[MSCStage.DISTILL] = {\"loader\": train_loader}\n",
    "    return TorchWrapper.create_config(\n",
    "        inputs=[(\"input\", [args.test_batch, 3, 32, 32], \"float32\")],\n",
    "        outputs=[\"output\"],\n",
    "        compile_type=args.compile_type,\n",
    "        dataset=dataset,\n",
    "        tools=tools,\n",
    "        verbose=args.verbose,\n",
    "        dynamic=args.dynamic,\n",
    "    )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path\n",
    "dataset = \".temp/msc_dataset\"\n",
    "dataset = Path(dataset)\n",
    "if not dataset.exists():\n",
    "    dataset.mkdir(parents=True)\n",
    "train_batch = 32\n",
    "test_batch = 1\n",
    "trainloader, testloader = get_dataloaders(dataset, train_batch, test_batch)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def _get_calib_datas(calibrate_iter, dynamic):\n",
    "    for i, (inputs, _) in enumerate(testloader, 0):\n",
    "        if i >= calibrate_iter > 0:\n",
    "            break\n",
    "        yield inputs if dynamic else {\"input\": inputs}\n",
    "\n",
    "def _get_train_datas(train_iter, dynamic):\n",
    "    for i, (inputs, _) in enumerate(trainloader, 0):\n",
    "        if i >= train_iter > 0:\n",
    "            break\n",
    "        yield inputs if dynamic else {\"input\": inputs}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from _resnet import resnet50\n",
    "checkpoint = \".temp/msc_models\" # The folder saving training and testing datas\n",
    "checkpoint = Path(checkpoint)\n",
    "checkpoint.mkdir(exist_ok=True, parents=True)\n",
    "# 参考 https://github.com/huyvnphan/PyTorch_CIFAR10/tree/master?tab=readme-ov-file\n",
    "\n",
    "\n",
    "model = resnet50(pretrained=str(checkpoint))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "if torch.cuda.is_available():\n",
    "    model = model.to(torch.device(\"cuda:0\"))\n",
    "\n",
    "test_iter = 100 # 测试迭代次数\n",
    "acc = eval_model(model, testloader, max_iter=test_iter)\n",
    "print(\"Baseline acc: \" + str(acc))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = TorchWrapper(model, get_config(_get_calib_datas, _get_train_datas, Args()))\n",
    "\n",
    "# optimize the model with tool\n",
    "model.optimize()\n",
    "acc = eval_model(model, testloader, max_iter=test_iter)\n",
    "print(\"Optimized acc: \" + str(acc))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import torch.optim as optim\n",
    "train_iter = 100\n",
    "train_epoch = 5\n",
    "# train the model with tool\n",
    "optimizer = optim.Adam(model.parameters(), lr=0.0000001, weight_decay=0.08)\n",
    "for ep in range(train_epoch):\n",
    "    train_model(model, trainloader, optimizer, max_iter=train_iter)\n",
    "    acc = eval_model(model, testloader, max_iter=test_iter)\n",
    "    print(\"Train[{}] acc: {}\".format(ep, acc))\n",
    "\n",
    "# compile the model\n",
    "model.compile()\n",
    "acc = eval_model(model, testloader, max_iter=test_iter)\n",
    "print(\"Compiled acc: \" + str(acc))\n",
    "\n",
    "# export the model\n",
    "path = model.export()\n",
    "print(\"Export model to \" + str(path))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "file_costtime =\"/media/pc/data/board/arria10/lxw/tasks/tools/npuusertools/temp/xmdemo.fa_color_bertha/inference/outputs/costtime_perf_first_L0.log\"\n",
    "with open(file_costtime) as fp:\n",
    "    time_info = fp.read()\n",
    "import re\n",
    "match = re.search(r\"first run time:\\s*(\\d+)\\s*ms\\n\", time_info)\n",
    "if match:\n",
    "    time_value = match.group(1)\n",
    "time_info = time_info.replace(match.group(0), \"$\").split(\"$\")[1]\n",
    "time_info = time_info.split(\"================================================================\\ntimer end\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "profiler:\n",
      "{\"VTA_TOPI_yuv420sp2rgb_N0\": {\n",
      " \"inp_load_nbytes\":5760,\n",
      " \"wgt_load_nbytes\":0,\n",
      " \"acc_load_nbytes\":0,\n",
      " \"uop_load_nbytes\":0,\n",
      " \"alu_uop_load_nbytes\":0,\n",
      " \"alu_tab_load_nbytes\":0,\n",
      " \"bias_load_nbytes\":0,\n",
      " \"out_store_nbytes\":10800,\n",
      " \"gemm_counter\":0,\n",
      " \"alu_counter\":0\n",
      "}\n",
      "}\n",
      "profiler_end\n",
      "{\n",
      " \"mem_weight\":59648,\n",
      " \"mem_op\":34848,\n",
      " \"mem_lib\":21408,\n",
      " \"mem_total\":115904,\n",
      " \"run_time\":28\n",
      "}\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(time_info[-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'ms'"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "match = re.search(r\"first run time:\\s*(\\d+)\\s*ms\\n\", time_info)\n",
    "    if match:\n",
    "        pre_infer_time = match.group(1)\n",
    "    unit_time = match.group(0)[match.group(0).find(pre_infer_time):].strip().split(\" \")[1]\n",
    "    assert \"ms\" in unit_time.strip() == \"ms\", f\"时间单位 {unit_time.strip()} 出错\"\n",
    "    time_info = time_info.replace(match.group(0), \"$\").split(\"$\")[1]\n",
    "    time_info = time_info.split(\"\\n================================================================\\ntimer end\")\n",
    "    summary = eval(time_info[-1]) #"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'first run time: 34 ms\\n'"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'profiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 27829,\\n\"VTA_TOPI_maxpool2d_N0\": 319,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2487,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 478,\\n\"VTA_TOPI_dense_N0\": 157,\\n\"VTA_TOPI_dense1_N0\": 80,\\n\"total time\": 31350}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 52,\\n\"total time\": 52}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 27819,\\n\"VTA_TOPI_maxpool2d_N0\": 301,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2485,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 483,\\n\"VTA_TOPI_dense_N0\": 147,\\n\"VTA_TOPI_dense1_N0\": 78,\\n\"total time\": 31313}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 42,\\n\"total time\": 42}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 27823,\\n\"VTA_TOPI_maxpool2d_N0\": 305,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2486,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 486,\\n\"VTA_TOPI_dense_N0\": 152,\\n\"VTA_TOPI_dense1_N0\": 78,\\n\"total time\": 31330}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 43,\\n\"total time\": 43}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 27811,\\n\"VTA_TOPI_maxpool2d_N0\": 306,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2485,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 481,\\n\"VTA_TOPI_dense_N0\": 149,\\n\"VTA_TOPI_dense1_N0\": 79,\\n\"total time\": 31311}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 43,\\n\"total time\": 43}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 27791,\\n\"VTA_TOPI_maxpool2d_N0\": 305,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2429,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 417,\\n\"VTA_TOPI_dense_N0\": 166,\\n\"VTA_TOPI_dense1_N0\": 63,\\n\"total time\": 31171}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 42,\\n\"total time\": 42}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 23998,\\n\"VTA_TOPI_maxpool2d_N0\": 232,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2142,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 398,\\n\"VTA_TOPI_dense_N0\": 154,\\n\"VTA_TOPI_dense1_N0\": 68,\\n\"total time\": 26992}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 34,\\n\"total time\": 34}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 23972,\\n\"VTA_TOPI_maxpool2d_N0\": 264,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2100,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 435,\\n\"VTA_TOPI_dense_N0\": 126,\\n\"VTA_TOPI_dense1_N0\": 77,\\n\"total time\": 26974}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 36,\\n\"total time\": 36}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 24807,\\n\"VTA_TOPI_maxpool2d_N0\": 274,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2113,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 407,\\n\"VTA_TOPI_dense_N0\": 118,\\n\"VTA_TOPI_dense1_N0\": 63,\\n\"total time\": 27782}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 35,\\n\"total time\": 35}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 23965,\\n\"VTA_TOPI_maxpool2d_N0\": 252,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2176,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 378,\\n\"VTA_TOPI_dense_N0\": 118,\\n\"VTA_TOPI_dense1_N0\": 62,\\n\"total time\": 26951}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 33,\\n\"total time\": 33}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": {\\n \"inp_load_nbytes\":46656,\\n \"wgt_load_nbytes\":165888,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":996,\\n \"alu_uop_load_nbytes\":20,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":13824,\\n \"out_store_nbytes\":23328,\\n \"gemm_counter\":48762,\\n \"alu_counter\":22248\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_maxpool2d_N0\": {\\n \"inp_load_nbytes\":0,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":23328,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":60,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":6272,\\n \"gemm_counter\":0,\\n \"alu_counter\":1224\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d_N0\": {\\n \"inp_load_nbytes\":6272,\\n \"wgt_load_nbytes\":9216,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":2304,\\n \"alu_uop_load_nbytes\":24,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":256,\\n \"out_store_nbytes\":1152,\\n \"gemm_counter\":5184,\\n \"alu_counter\":504\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_conv2d_maxpool2d1_N0\": {\\n \"inp_load_nbytes\":1152,\\n \"wgt_load_nbytes\":13824,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":384,\\n \"alu_uop_load_nbytes\":28,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":384,\\n \"out_store_nbytes\":192,\\n \"gemm_counter\":864,\\n \"alu_counter\":84\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense_N0\": {\\n \"inp_load_nbytes\":1536,\\n \"wgt_load_nbytes\":24576,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":48,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":1024,\\n \"out_store_nbytes\":128,\\n \"gemm_counter\":96,\\n \"alu_counter\":8\\n}\\n}\\nprofiler_end\\nprofiler:\\n{\"VTA_TOPI_dense1_N0\": {\\n \"inp_load_nbytes\":128,\\n \"wgt_load_nbytes\":2048,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":32,\\n \"alu_uop_load_nbytes\":8,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":128,\\n \"out_store_nbytes\":16,\\n \"gemm_counter\":8,\\n \"alu_counter\":1\\n}\\n}\\nprofiler_end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_conv2d_maxpool2d_conv2d_N0\": 23922,\\n\"VTA_TOPI_maxpool2d_N0\": 265,\\n\"VTA_TOPI_conv2d_maxpool2d_N0\": 2151,\\n\"VTA_TOPI_conv2d_maxpool2d1_N0\": 457,\\n\"VTA_TOPI_dense_N0\": 130,\\n\"VTA_TOPI_dense1_N0\": 62,\\n\"total time\": 26987}\\n================================================================\\ntimer end\\ntimer start\\n================================================================\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": 44,\\n\"total time\": 44}\\n================================================================\\ntimer end\\nprofiler:\\n{\"VTA_TOPI_yuv420sp2rgb_N0\": {\\n \"inp_load_nbytes\":5760,\\n \"wgt_load_nbytes\":0,\\n \"acc_load_nbytes\":0,\\n \"uop_load_nbytes\":0,\\n \"alu_uop_load_nbytes\":0,\\n \"alu_tab_load_nbytes\":0,\\n \"bias_load_nbytes\":0,\\n \"out_store_nbytes\":10800,\\n \"gemm_counter\":0,\\n \"alu_counter\":0\\n}\\n}\\nprofiler_end\\n{\\n \"mem_weight\":59648,\\n \"mem_op\":34848,\\n \"mem_lib\":21408,\\n \"mem_total\":115904,\\n \"run_time\":29\\n}\\n'"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "xxx",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
